Class actions

Class actions are actions that always have the context or the root objects as the object of a class. A class action cannot use the ViewModel vCurrent or vSelected variables. A class action, therefore, is always based upon the object itself in the model, not on any information from the ViewModel. They are globally available to every view that shows an object of this class. 

Preferably, you make class actions for everything that can be class actions because they are then available wherever that object is shown within your application. 

You show a class's class actions by clicking on the little arrow triangle at the top of the class from the diagram view. 

Class Actions - Image 1.png 

Or directly access available actions and also add an action. Right-click on the class header and select "Add Class action." 

Class Actions - Image 2.png 

This window pops up.  

Class Actions - Image 3.png 

When showing this view with class actions, you can also create new class actions and drag actions. The drag action is when one object is dragged on-screen from one object on top of another. 

Name the class action using camel case. That camel casing will then be split with spaces in between; it will give you an easy way to have a good action name until you want to change the presentation. 

Class Actions - Image 4.png 

If you click on the Enable Expression or Execute Expression, you can see that the context is the class itself. 

Class Actions - Image 5.png 

If you use "self" here, you will get the SysSuperClass in this example as a context - because it is a class action and always has its root or context as an instance of this class. 

Class actions Image 6.png 

In other respects, you can see the general action information.

This page was edited 157 days ago on 06/17/2024. What links here